package com.iris;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description :
 * @author : Iris.Xiao
 * @date : 2017/11/8 19:18
 *
{application}映射到Config客户端的spring.application.name属性
{profile}映射到Config客户端的spring.profiles.active属性，可以用来区分环境
{label}映射到Git服务器的commit id, 分支名称或者tag，默认值为master
/{application}/{profile}[/{label}]
/{application}-{profile}.yml
/{label}/{application}-{profile}.yml
/{application}-{profile}.properties
/{label}/{application}-{profile}.properties
 */
@SpringBootApplication
@RestController
@EnableAutoConfiguration
@ComponentScan
public class ConfigClientApplication {

	public static void main(String[] args) {
		SpringApplication.run(ConfigClientApplication.class, args);
		System.out.println("=============");
	}

	@Value("${confittest}")
	String confittest;
	@RequestMapping(value = "/configTest")
	public String configTest(){
		return confittest;
	}
}
